home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-081.TXT < prev    next >
Encoding:
Text File  |  1992-06-30  |  43.1 KB  |  1,233 lines

  1. C.S.M.P. Digest             Fri, 15 May 92       Volume 1 : Issue 81
  2.  
  3. Today's Topics:
  4.  
  5.     TextWidth and LaserWriters
  6.     MacBinary source
  7.     Problems with ResEdit2.1
  8.     Think C, TCL, AppleTalk Async calls and a question
  9.     Anybody know the SE "Easter Egg?"
  10.     debugging tools for lisp
  11.     Network copy protection problems
  12.     Problem with PBHGetFInfo
  13.     Regular reading of a serial device-how?
  14.     How to read 10 sectors per track on floppy? (Repost)
  15.     WWDC Dinner?
  16.     archive site for Frontier stuff?
  17.     What is Discipline?
  18.     32K boundary problem?
  19.  
  20.  
  21. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  22.  
  23. These digests are available (by using FTP, account anonymous, your email
  24. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  25. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  26. Questions list.  The last several issues of the digest are available from
  27. sumex-aim.stanford.edu as well.
  28.  
  29. These digests are also available via email.  Just send a note saying that you
  30. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  31. automatically receive each new digest as it is created.
  32.  
  33. The digest is a collection of articles from the internet newsgroup comp.sys.
  34. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  35. and want an archive of the discussions.  If you don't know what a newsgroup
  36. is, you probably don't have access to it.  Ask your systems administrator(s)
  37. for details.  (This means you can't post questions to the digest.)
  38.  
  39. The articles in these digests are taken directly from comp.sys.mac.programmer.
  40. They are not edited; all articles included in this digest are in their original
  41. posted form.  The only articles that are -not- included in these digests are
  42. those which didn't receive any replies (except those that give information
  43. rather than ask a question).  All replies to each article are concatenated
  44. onto the original article in the order in which they were received.  Article
  45. threads are not added to the digests until the last article added to the
  46. thread is at least one month old (this is to ensure that the thread is dead
  47. before adding it to the digests).
  48.  
  49. Send administrative mail to mkelly@cs.uoregon.edu.
  50.  
  51. -------------------------------------------------------
  52.  
  53. From: Paul.L.Merchant.Jr.@dartmouth.edu (Paul L Merchant Jr.)
  54. Subject: TextWidth and LaserWriters
  55. Date: 9 Apr 92 13:16:40 GMT
  56. Organization: Dartmouth College, Hanover, NH
  57.  
  58. I'm having trouble spacing text properly on a LaserWriter.  I'm trying
  59. to draw two strings, the second following the first by x "pixels".  The
  60. procedure I'm using looks like this:
  61.  
  62. MoveTo(startx, starty);
  63. DrawText(text1);
  64. Move(x, 0);
  65. DrawText(text2);
  66.  
  67. The problem is that apparently the LaserWriter's idea of the pen
  68. location after the first DrawText is different from the GrafPort's idea
  69. of the pen's location.  So the space between text1 and text2 is much
  70. larger than I want.  The effect seems to vary with the font choice with
  71. the reproduction being best if I have chosen a LaserWriter font such as
  72. Helvetica.  (This code is part of an application which allows the user
  73. to select any available font.)
  74.  
  75. The problem is really dramatic if the following lines are added after
  76. the first DrawText:
  77.  
  78. Line(0, -10);
  79. Move(0, 10);
  80.  
  81.  
  82. This should draw a vertical line immediately after the text, right? 
  83. Wrong.  Instead I get a diagonal line whose width is equal to the error
  84. between the different measurements.
  85.  
  86. I have tried using SetFractsEnable set to both true and false, and I
  87. have tried Font Subtitution and Text Smoothing enabled and disabled. 
  88. All have an effect on the problem, but none cure it.
  89.  
  90. My questions then are:
  91.  
  92. 1. Is there any way to discover the "true" pen location when printing
  93. since it does not appear to be available using GetPen?
  94.  
  95. 2.  If not, is there a way to discover what the actual printed text
  96. width is?  I have compared the results of TextWidth(text1) within the
  97. printing GrafPort and a screen GrafPort and they are the same.  I have
  98. also used the global font width table to compute my own text widths and
  99. still found no difference.
  100.  
  101. 3.  Is there any way to find out what font the LaserWriter is
  102. substituting when it is drawing?
  103.  
  104. 4.  Is there another way to make the spacing between text1 and text2
  105. accurate?  (There must be some way, or word processors would never be
  106. able to do justification.)
  107.  
  108. 5.  Is there any documentation about this anywhere?
  109.  
  110. And on a related topic:
  111.  
  112. 6.  How can I find out which fonts are "fixed width"?  I thought about
  113. looking at the fontType field of the font record until I discovered
  114. that it described Monaco as a proportional font even though it appears
  115. to be fixed width.
  116.  
  117. Thanks in advance for any help you can give me!
  118.  
  119. Paul Merchant
  120. Paul.Merchant@Dartmouth.EDU
  121.  
  122. +++++++++++++++++++++++++++
  123.  
  124. From: CXT105@psuvm.psu.edu (Christopher Tate)
  125. Date: 14 Apr 92 18:19:27 GMT
  126. Organization: Penn State University
  127.  
  128. You need to read, carefully and patiently, the Tech Notes that discuss
  129. printing in general, and LaserWriters in particular.  I don't recall just
  130. which Tech Notes they are, but the numbers 92 and 86 stick in my mind.
  131. Get the index (or the Tech Notes Stack), and go from there.
  132.  
  133. Basically, when you print text to the LaserWriter all manner of strange
  134. and wonderous things may happen, such as Font Substitution, which will
  135. play merry hell with the actual position of text and other graphics on
  136. the page.  Get the tech notes and study them, and experiment a lot.
  137.  
  138. And be glad you don't have to pay $0.25 per page when experimenting,
  139. the way I did....  :-(
  140.  
  141. - -------
  142. Christopher Tate        |  "Computer Science has more real-world
  143.                         |   applications than rotisserie baseball."
  144. cxt105@psuvm.psu.edu    |
  145. Bitnet:  CXT105@PSUVM   |       -- Ben Liblit, next-door neighbor
  146.  
  147. ---------------------------
  148.  
  149. From: francois@welchgate.welch.jhu.edu (Francois Schiettecatte)
  150. Subject: MacBinary source
  151. Date: 10 Apr 92 21:02:32 GMT
  152. Organization: Johns Hopkins Univ. Welch Medical Library
  153.  
  154. Hi
  155.  
  156. I am looking for C source to convert MacBinary files downloaded
  157. from a Unix box to a proper mac file. Ideally this source 
  158. should be public domain, can anybody give me any pointers?
  159.  
  160.  
  161. francois
  162.  
  163.  
  164.  
  165. Francois Schiettecatte
  166. Internet: francois@library.welch.jhu.edu
  167. Phone    : (410) 955-7581
  168.  
  169. +++++++++++++++++++++++++++
  170.  
  171. From: mwalker@wc.novell.com (Mel Walker)
  172. Organization: Novell, Inc. - Walnut Creek
  173. Date: Tue, 14 Apr 1992 14:40:26 GMT
  174.  
  175. Does anyone out there know of a site from which I can download the source
  176. code for doing MacBinary file conversion?  I would much appreciate it.
  177. Thanks,
  178. - --Mel Walker                                 mwalker@optics.wc.novell.com
  179.  
  180. ---------------------------
  181.  
  182. From: pdt@unix.brighton.ac.uk (taylor)
  183. Subject: Problems with ResEdit2.1
  184. Date: 13 Apr 92 08:40:38 GMT
  185. Organization: Brighton Polytechnic, UK
  186.  
  187. I have ResEdit 2.1 which seems to work fine except when I try to change the
  188. name or ID of a resource. Attempting to do this results in the machine
  189. locking up. I am using system 7.0 - does anyone else have this problem or
  190. have I got a duff version? Help!
  191.  
  192. Paul Taylor
  193. Brighton Polytechnic
  194. England
  195.  
  196. +++++++++++++++++++++++++++
  197.  
  198. From: jbush@magnus.acs.ohio-state.edu (John E Bush)
  199. Date: 13 Apr 92 12:08:30 GMT
  200. Organization: The Ohio State University
  201.  
  202. In article <1992Apr13.084038.29113@unix.brighton.ac.uk> pdt@unix.brighton.ac.uk
  203.  (taylor) writes:
  204. >I have ResEdit 2.1 which seems to work fine except when I try to change the
  205. >name or ID of a resource. Attempting to do this results in the machine
  206. >locking up. I am using system 7.0 - does anyone else have this problem or
  207. >have I got a duff version? Help!
  208. >
  209. >Paul Taylor
  210.  
  211. Paul,
  212.  
  213. The latest version of ResEdit is 2.1.1 and is available on Apple's ftp site.
  214. I used to have the same problem that you are experiencing, but have not had
  215. the problem since I upgraded versions.
  216.  
  217. Eric Bush
  218.  
  219. ---------------------------
  220.  
  221. From: jsuker@orion.oac.uci.edu (Johnathon L. Suker)
  222. Subject: Think C, TCL, AppleTalk Async calls and a question
  223. Organization: Univesity of California at Irvine Main Library
  224. Date: 10 Apr 92 22:37:50 GMT
  225.  
  226. Hey AppleTalk and Think Class Library,
  227.  
  228.     I have a programming question regarding AppleTalk programming and 
  229. the think class library.  I am going to write (am writing) a programming 
  230. that uses appletalk and sends syncronous calls.  I want to change them to 
  231. Async. calls.  According to Inside AppleTalk, to should check for async 
  232. calls in the main event loop of your program.  In TCL I do not have access 
  233. to this and inorder to put something in their I must changing the source 
  234. code of TCL (which Symantec says is BAD).  Has anyone (or does anyone) know 
  235. how to make Async calls within TCL.  I would really like to use the TCL (my 
  236. first big project using it) and this is the only thing holding me back.
  237.  
  238.                 Thanks in advance,
  239.  
  240.                     Johnathon
  241. _______________________________________________________________________________
  242. Johnathon Suker           |
  243. UC Irvine                 |   .signature file under construction
  244. jsuker@orion.oac.uci.edu  |
  245. _______________________________________________________________________________
  246.  
  247. +++++++++++++++++++++++++++
  248.  
  249. From: lkimes@alshain.usc.edu (Lance 'Moof' Kimes)
  250. Date: 10 Apr 1992 19:17:45 -0700
  251. Organization: University of Southern California, Los Angeles, CA
  252.  
  253.  
  254. In article <jsuker.23@orion.oac.uci.edu>, jsuker@orion.oac.uci.edu (Johnathon L. Suker) writes:
  255. |> Hey AppleTalk and Think Class Library,
  256. |> 
  257. |>     I have a programming question regarding AppleTalk programming and 
  258. |> the think class library.  I am going to write (am writing) a programming 
  259. |> that uses appletalk and sends syncronous calls.  I want to change them to 
  260. |> Async. calls.  According to Inside AppleTalk, to should check for async 
  261. |> calls in the main event loop of your program.  In TCL I do not have access 
  262. |> to this and inorder to put something in their I must changing the source 
  263. |> code of TCL (which Symantec says is BAD).  Has anyone (or does anyone) know 
  264. |> how to make Async calls within TCL.  I would really like to use the TCL (my 
  265. |> first big project using it) and this is the only thing holding me back.
  266. |> 
  267. |>                 Thanks in advance,
  268. |> 
  269. |>                     Johnathon
  270. |> _______________________________________________________________________________
  271. |> Johnathon Suker           |
  272. |> UC Irvine                 |   .signature file under construction
  273. |> jsuker@orion.oac.uci.edu  |
  274. |> _______________________________________________________________________________
  275.  
  276.  
  277. When I first started TCL programming I made the same mistake, but remember that TCL is a class library!!
  278.  
  279. CMyClass : public CApplication
  280.  
  281.  
  282. override Process1Event
  283.  
  284. void CMyClass::Process1Event( void)
  285. {
  286.  
  287.  
  288. my stuff & checking
  289.  
  290.  
  291. inherited::Process1Event();
  292. }
  293.  
  294. then call CApplication method for processing events
  295.  
  296.  
  297.  
  298. Hope it helps
  299.  
  300. Lance Kimes
  301. USC
  302.  
  303. +++++++++++++++++++++++++++
  304.  
  305. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  306. Date: 11 Apr 92 10:30:48 GMT
  307. Organization: Royal Institute of Technology, Stockholm, Sweden
  308.  
  309. .uci.edu> jsuker@orion.oac.uci.edu (Johnathon L. Suker) writes:
  310.  
  311.    calls in the main event loop of your program.  In TCL I do not have access 
  312.    to this and inorder to put something in their I must changing the source 
  313.    code of TCL (which Symantec says is BAD).  Has anyone (or does anyone) know 
  314.  
  315. Of course you do !
  316.  
  317. Your gopher will get a dawdle message, or you can install~
  318. CIdleChores.
  319.  
  320. - -- 
  321. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  322.  
  323. +++++++++++++++++++++++++++
  324.  
  325. From: minow@ranger.enet.dec.com (Martin Minow)
  326. Date: 11 Apr 92 20:33:37 GMT
  327. Organization: Digital Equipment Corporation
  328.  
  329.  
  330. In article <jsuker.23@orion.oac.uci.edu>, jsuker@orion.oac.uci.edu
  331. (Johnathon L. Suker) asks about asychronous I/O and the Think library.
  332.  
  333. The simplest solution is to create a CChore to watch for I/O completion.
  334. If your I/O needs are more elaborate, you might want to create your
  335. own action queue using roughly the following algorithm:
  336.  
  337. Your I/O routine (PBControl or similar) establishes an I/O completion
  338. handler.  This is a short assembly-language stub that queues the I/O
  339. block into a private queue.  Your CChore then looks for a non-empty
  340. queue and, if it finds something, dequeues the first element and
  341. processes it.
  342.  
  343. To save you much head-scratching, create your I/O request as follows:
  344.     struct MyIORecord {
  345.         long    applicationA5;
  346.         ParamBlock    pbRec;
  347.         ... other data for the I/O request ...
  348.     };
  349.  
  350. Create the I/O request by
  351.  
  352.     anIORequest.applicationA5 = (long) CurrentA5;
  353.     ... other parameters ...
  354.     anIORequest.pbRec.ioCompletion = (ProcPtr) MyCompletionRoutine;
  355.     status = PBControlAsync(&anIORequest.pbRec);
  356.  
  357. The completion routine is as follows:
  358.  
  359. QHdr        gProcessQueue;
  360.  
  361. pascal void
  362. MyCompletionRoutine()
  363. {
  364.     asm {
  365.         move.l    a5,-(sp)        ; Save current A5
  366.         move.l    -4(a0),a5        ; Restore application A5
  367.         lea        gProcessQueue,a1    ; My queue header
  368.         _Enqueue                ; Put buffer in my queue
  369.         movea.l    (sp)+,a5        ; Restore A5
  370.     }
  371. }
  372.  
  373. Your CChore or idle loop should call a "dequeue" function defined as follows:
  374.  
  375. /*
  376.  * Get an element from the queue, return NULL if none.
  377.  */
  378. struct MyIORecord *
  379. GetFromQueue(void)
  380. {
  381.     QHdrPtr        theQueue;
  382.     QElemPtr    qElemPtr;
  383.  
  384.     theQueue = &gProcessQueue;        /* Parameter, perhaps    */
  385.     if ((qElemPtr = theQueue->qHead) == NULL)
  386.         return (NULL);
  387.     else {
  388.         Dequeue(qElemPtr, theQueue);
  389.         return ((struct MyIORecord *) (((long) qElemPtr) - sizeof (long)));
  390.     }
  391. }
  392.  
  393. This was retyped from working code: apologies for any errors that crept in.
  394. Note that your CChore should set a short maxSleep time if the queue is
  395. non-empty. (The method that calls PBControlAsynch must also set a
  396. small value in gSleepTime.)
  397.  
  398. Martin Minow
  399. minow@ranger.enet.dec.com
  400.  
  401. ---------------------------
  402.  
  403. From: fcs@teal.csn.org (M. Scott Marcy)
  404. Subject: Anybody know the SE "Easter Egg?"
  405. Organization: Colorado SuperNet, Inc.
  406. Date: Sat, 11 Apr 1992 05:44:15 GMT
  407.  
  408. I was just wondering if anybody out there knows and remembers the address of
  409. the "Easter Egg" in the original SE ROMs?  It's the one which draws the
  410. pictures of the development team.
  411.  
  412. I guess while I'm at it, any other "Eggs" would be appreciated, too (other
  413. Macs, any software, etc.).  I know the one about the Zebra Lady in
  414. Mac Paint II.
  415.  
  416. I'll summarize to the net if I get anything new.
  417.  
  418. Thanks!
  419.  
  420. - -Scott
  421.  
  422. - -- 
  423. M. Scott Marcy                            Internet:  fcs@csn.org
  424. First Class Systems, Inc.                 Applelink: FIRST.CLASS
  425. PO Box 50005
  426. Colorado Springs, CO  80949 USA           Disclaimer: I own the company!
  427.  
  428. +++++++++++++++++++++++++++
  429.  
  430. From: neal@farallon.com (Neal Trautman)
  431. Date: 11 Apr 92 18:55:48 GMT
  432. Organization: Farallon Computing, Inc.
  433.  
  434. In article <1992Apr11.054415.13203@csn.org>, fcs@teal.csn.org (M. Scott Marcy) writes:
  435. > I was just wondering if anybody out there knows and remembers the address of
  436. > the "Easter Egg" in the original SE ROMs?  It's the one which draws the
  437. > pictures of the development team.
  438.  
  439. Here's the THINK C source code for a small
  440. application I wrote years ago to show the pictures.
  441.  
  442. Enjoy...
  443. Neal Trautman
  444. Timbuktu Lead Software Engineer
  445. Farallon Computing, Inc.
  446. neal@farallon.com
  447.  
  448.  
  449. main()
  450. {
  451.     SysEnvRec        MacInfo;
  452.     EventRecord        theEvent;
  453.     long            time;
  454.     int                i;
  455.     
  456.     InitGraf(&thePort);
  457.     InitFonts();
  458.     FlushEvents(everyEvent, 0);
  459.     InitWindows();
  460.     InitDialogs(0L);
  461.     InitCursor();
  462.     SysEnvirons(1, &MacInfo);
  463.     if (MacInfo.machineType != envSE)
  464.         {
  465.         ExitToShell();
  466.         }
  467.     asm
  468.         {
  469.         jsr        0x41D8B4
  470.         }
  471.     for(;;)
  472.         {
  473.         asm
  474.             {
  475.             addq.l    #4,D7
  476.             andi.l    #0x0C,D7
  477.             jsr        0x41D8D6
  478.             }
  479.         for (i=0; i<=8; i++)
  480.             {
  481.             if (Button())
  482.                 ExitToShell();
  483.             Delay(20L,&time);
  484.             }
  485.         }
  486. }
  487.  
  488. ---------------------------
  489.  
  490. From: ckyu@leland.Stanford.EDU (Chen-Kuang Yu)
  491. Subject: debugging tools for lisp
  492. Date: 11 Apr 92 17:49:26 GMT
  493. Organization: DSG, Stanford University, CA 94305, USA
  494.  
  495. I've been using lisp on the NeXT machines and recently have to do some
  496. programming on the mcl.  However I find the STEP and TRACE debugging
  497. macro rather crude on the mcl.  I wonder if it's mentioned in the
  498. manual that there are some other more powerful debugging tools
  499. available.  (I'm using the program running on the server of our schoo.
  500. The consultant said the manual was lost, so there's no way for me to
  501. check it out.)
  502.  
  503. BTW, are there any ftp sites where they keep a bunch of useful lisp
  504. codes such as a modified TRACE or STEP?
  505.  
  506. Thank in advance.
  507.  
  508. /Chen Yu (yu@cs.stanford.edu)
  509.  
  510. +++++++++++++++++++++++++++
  511.  
  512. From: ksand@apple.com (Kent Sandvik)
  513. Date: 14 Apr 92 19:36:02 GMT
  514. Organization: MacDTS Mongols
  515.  
  516. In article <1992Apr11.174926.1639@leland.Stanford.EDU>, ckyu@leland.Stanford.EDU
  517. (Chen-Kuang Yu) writes:
  518. > I've been using lisp on the NeXT machines and recently have to do some
  519. > programming on the mcl.  However I find the STEP and TRACE debugging
  520. > macro rather crude on the mcl.  I wonder if it's mentioned in the
  521. > manual that there are some other more powerful debugging tools
  522. > available.  (I'm using the program running on the server of our schoo.
  523. > The consultant said the manual was lost, so there's no way for me to
  524. > check it out.)
  525.  
  526. As I know STEP and TRACE are the default Common Lisp utilities under
  527. MCL. There's an inspector which you could use for inspecting data 
  528. structures. 
  529.   
  530. > BTW, are there any ftp sites where they keep a bunch of useful lisp
  531. > codes such as a modified TRACE or STEP?
  532.  
  533. cambridge.apple.com has MCL code, you might check their archives.
  534.  
  535. Cheers,
  536. Kent Sandvik
  537.  
  538. ---------------------------
  539.  
  540. From: nebel@wam.umd.edu (Chris D. Nebel)
  541. Subject: Network copy protection problems
  542. Organization: University of Maryland, College Park
  543. Date: Sat, 11 Apr 1992 23:20:23 GMT
  544.  
  545. I'm trying to write one of those things that checks to make sure that you're
  546. only running one copy of the same program at once on an Appletalk network.
  547. (Please, no flames from folks that think this practice is evil.  This is my
  548. job we're talking about, here.)  Anyway, I've got a little thing written that
  549. registers the "name" (all right, the serial number) of the program using
  550. NBPRegister; if NBPRegister comes back with a duplicate name error, then it
  551. decides that another copy is being run somewhere and exits.  (The program
  552. unregisters the name when you quit.)
  553.  
  554. This works pretty well, but there are two major problems.  One, it only checks
  555. the current zone.  I'd like it to check ALL the zones, but I can't seem to find
  556. anything at all on zones in IM except for an occasional mention of '*' -- where
  557. does Apple hide this information, anyway?
  558.  
  559. Problem number two is more serious: if the program terminates abnormally (read:
  560. crashes! (or the user kills it, or whatever)), then the name never gets
  561. unregistered.  So when they try to launch again, it says "This copy is already
  562. being used!"  Oh, joy.  I tried turning off self-send during the inital name-
  563. check, and that seems to work, but when it tries to unregister the name,
  564. something fairly horrible must happen, because the Finder almost always
  565. crashes a few seconds after I quit.
  566.  
  567. Any tips/pointers/useful comments would be greatly appreciated.
  568.  
  569. Thanks,
  570. Chris Nebel
  571. nebel@wam.umd.edu
  572.  
  573. +++++++++++++++++++++++++++
  574.  
  575. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  576. Date: 12 Apr 92 16:30:37 GMT
  577. Organization: Peirce Software
  578.  
  579.  
  580. In article <1992Apr11.232023.11368@wam.umd.edu> (comp.sys.mac.programmer), nebel@wam.umd.edu (Chris D. Nebel) writes:
  581. > I'm trying to write one of those things that checks to make sure that you're
  582. > only running one copy of the same program at once on an Appletalk network.
  583. > (Please, no flames from folks that think this practice is evil.  This is my
  584. > job we're talking about, here.)  Anyway, I've got a little thing written that
  585. > registers the "name" (all right, the serial number) of the program using
  586. > NBPRegister; if NBPRegister comes back with a duplicate name error, then it
  587. > decides that another copy is being run somewhere and exits.  (The program
  588. > unregisters the name when you quit.)
  589. > This works pretty well, but there are two major problems.  One, it only checks
  590. > the current zone.  I'd like it to check ALL the zones, but I can't seem to find
  591. > anything at all on zones in IM except for an occasional mention of '*' -- where
  592. > does Apple hide this information, anyway?
  593.  
  594. You need to use the Zone Information Protocol, ZIP, to find out what
  595. zones exist in your network.  With it you can lookup the name in each
  596. zone.
  597.  
  598. Of course, this will take FOREVER in a large network environment -
  599. and there are many large AppleTalk networks out there.
  600.  
  601. You need to be a little more clever than just checking everywhere.
  602. Do something like only picking a couple of random zones each time you
  603. start up.  
  604.  
  605. Before you release your product do some serious testing of your scheme
  606. on a real network (at least a few dozen zones with real traffic) and
  607. make sure you aren't hogging all the resources or causing other problems
  608. for people.  Your customers will be happier and so will you - you
  609. don't want people dumping your product because it nukes their network!
  610.  
  611. > Problem number two is more serious: if the program terminates abnormally (read:
  612. > crashes! (or the user kills it, or whatever)), then the name never gets
  613. > unregistered.  So when they try to launch again, it says "This copy is already
  614. > being used!"  Oh, joy.  I tried turning off self-send during the inital name-
  615. > check, and that seems to work, but when it tries to unregister the name,
  616. > something fairly horrible must happen, because the Finder almost always
  617. > crashes a few seconds after I quit.
  618.  
  619. Patch the ExitToShell trap and do your unregistering there.
  620.  
  621. Not only are you getting a duplicate name, but worse, NBP still thinks
  622. it owns the block of memory that contains the original name.  This
  623. chunk of memory could very well be part of another program's memory
  624. space now!
  625.  
  626. - --  Michael Peirce         --   peirce@outpost.SF-Bay.org
  627. - --  Peirce Software        --   Suite 301, 719 Hibiscus Place
  628. - --  Macintosh Programming  --   San Jose, California USA 95117
  629. - --           & Consulting  --   voice: (408) 244-6554 fax: (408) 244-6882
  630. - --                         --   AppleLink: peirce & America Online: AFC Peirce
  631.  
  632. +++++++++++++++++++++++++++
  633.  
  634. From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
  635. Date: 12 Apr 92 22:20:23 GMT
  636.  
  637. In <D2150035.0r9ddv@outpost.SF-Bay.org> peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  638.  
  639.  
  640. >>[On a crash, names aren't being unregistered]
  641.  
  642. >Patch the ExitToShell trap and do your unregistering there.
  643.  
  644. >Not only are you getting a duplicate name, but worse, NBP still thinks
  645. >it owns the block of memory that contains the original name.  This
  646. >chunk of memory could very well be part of another program's memory
  647. >space now!
  648.  
  649. Yes, but this won't help you on a crash.  I don't know how comfortable
  650. you might feel with patching _SysError...
  651.  
  652. You will probably want to periodically want to poll the names in use,
  653. and simply ping each one to make sure they are still there.  If there
  654. was a crash, you wouln't get a ping, and you might want to take some
  655. action there.
  656.  
  657. If the user aborts (cmd-opt-esc), I don't know if _ExitToShell gets
  658. called.  Can you rely on it always being called in the future?  Perhaps
  659. a more future compatible way of doing this would be to make a small
  660. stub application that simply launches the main application.  The small
  661. one would accept ChildDied events, then know when to release the name.
  662. (when its child died).  If you had the main app register the name and
  663. the stub app remove it, I think you can be virtually guranteed future
  664. compatibility.
  665.  
  666.     - Scott
  667.  
  668. +++++++++++++++++++++++++++
  669.  
  670. From: zobkiw@world.std.com (Joe Zobkiw)
  671. Organization: The World Public Access UNIX, Brookline, MA
  672. Date: Mon, 13 Apr 1992 14:04:07 GMT
  673.  
  674. Chris -
  675.  
  676. I learned about Zones from IM VI I think...also check IM V.
  677.  
  678. As far as your problem...I do the exact same thing, from within an INIT
  679. and it works without a hitch. You mention that if the application crashes,
  680. the name doesn't unregister...this could be a problem...but you would hope
  681. that whenever someone's machine crashes, they will restart it just to be
  682. safe. When the machine is restarted, the registration will disappear and
  683. everything will be back to normal.
  684.  
  685. - -- 
  686. <--------------------------------------------------->
  687.  joe zobkiw                     zobkiw@world.std.com
  688.  mac.synthesis.MIDI.development.C.asm.communications
  689. >---------------------------------------------------<
  690.  
  691. +++++++++++++++++++++++++++
  692.  
  693. From: mwalker@wc.novell.com (Mel Walker)
  694. Organization: Novell, Inc.
  695. Date: Mon, 13 Apr 1992 14:48:13 GMT
  696.  
  697. >> Problem number two is more serious: if the program terminates abnormally (rea
  698. d
  699. >> crashes! (or the user kills it, or whatever)), then the name never gets
  700. >> unregistered.  So when they try to launch again, it says "This copy is alread
  701. y
  702. >> being used!"  Oh, joy.  I tried turning off self-send during the inital name-
  703. >> check, and that seems to work, but when it tries to unregister the name,
  704. >> something fairly horrible must happen, because the Finder almost always
  705. >> crashes a few seconds after I quit.
  706. >
  707. >Patch the ExitToShell trap and do your unregistering there.
  708. >
  709. >Not only are you getting a duplicate name, but worse, NBP still thinks
  710. >it owns the block of memory that contains the original name.  This
  711. >chunk of memory could very well be part of another program's memory
  712. >space now!
  713. >
  714. >--  Michael Peirce         --   peirce@outpost.SF-Bay.org
  715. >--  Peirce Software        --   Suite 301, 719 Hibiscus Place
  716. >--  Macintosh Programming  --   San Jose, California USA 95117
  717. >--           & Consulting  --   voice: (408) 244-6554 fax: (408) 244-6882
  718. >--                         --   AppleLink: peirce & America Online: AFC Peirce
  719.  
  720.  
  721. How does one patch the ExitToShell trap to do something? Sample or psuedo code,
  722. please...
  723.  
  724. - --Mel Walker
  725. mwalker@optics.wc.novell.com
  726. ** I have not yet developed a snazzy disclaimer **
  727.  
  728. +++++++++++++++++++++++++++
  729.  
  730. From: rgg@manutius.UUCP (Rick Gordon)
  731. Date: 14 Apr 92 00:09:41 GMT
  732. Organization: Aldus Corporation, Seattle WA
  733.  
  734.  
  735. regarding "pinging" every node periodically: this has a couple of faults.
  736. first it generates a lot of extra traffic, AT is bad enough with broadcasts
  737. why make it worse?
  738. second it's non-deterministic: network loads can vary significantly depending
  739. upon hops through routers. what you might this is a failed name is not.
  740. of course, even if you detect the name doesn't answer, you cannot remove the
  741. name from that nodes name table so now you have to keep a list of those nodes
  742. that contain bogus names. 
  743.  
  744. what i would suggest if NBP Register detects a match is doing an NBP Query
  745. and testing the node id against the local host. (You should be doing this
  746. anyway in case the user has SetSelfSend turned on.) If you detect this 
  747. situation at startup, you know it's because the name didn't properly get
  748. removed the last time, in which case you should probably advise the user
  749. to reboot. (Because NBP still has that block of memory - or thinks it does -
  750. containing the name that was originally registered. And who knows what's 
  751. happened between the time your application crashed and the time it was
  752. relaunched!)
  753.  
  754. rick_gordon@aldus.com
  755.  
  756. ---------------------------
  757.  
  758. From: dsb@mbunix.mitre.org
  759. Subject: Problem with PBHGetFInfo
  760. Date: 13 Apr 92 12:46:22 GMT
  761. Organization: The MITRE Corporation
  762.  
  763. Can anyone think why this returns -43 (file not found)
  764.  
  765.     gMultiFiles[index]->parID  is 1610667778
  766.     gMultiFiles[index]->vRefNum is 0
  767.     kFSAsynch is true
  768. - ----
  769.     HFileParam        fpb;
  770.  
  771.     /* prepare a hParamBlock */
  772.     fpb.ioCompletion = nil;
  773.     fpb.ioFVersNum = 0;
  774.     fpb.ioFDirIndex = 0;
  775.     fpb.ioNamePtr = CtoPstr(gMultiFiles[index]->name);
  776.     fpb.ioVRefNum = gMultiFiles[index]->vRefNum;
  777.     fpb.ioDirID = gMultiFiles[index]->parID;    
  778.     err = PBGetFInfo(&fpb,!kFSAsynch);
  779.  
  780. when this get s info on the file.  (I want to use this so I can look at files
  781. in different directories)
  782.  
  783.     FileParam        fpb;
  784.  
  785.     fpb.ioCompletion = nil;
  786.     fpb.ioFVersNum = 0;
  787.     fpb.ioFDirIndex = 0;
  788.     fpb.ioNamePtr = CtoPstr(gMultiFiles[index]->name);
  789.     fpb.ioVRefNum = gMultiFiles[index]->vRefNum;
  790.     err = PBGetFInfo(&fpb,!kFSAsynch);
  791.  
  792. +++++++++++++++++++++++++++
  793.  
  794. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  795. Date: 13 Apr 92 19:33:16 GMT
  796. Organization: Royal Institute of Technology, Stockholm, Sweden
  797.  
  798. .mitre.org> dsb@mbunix.mitre.org writes:
  799.  
  800.    Can anyone think why this returns -43 (file not found)
  801.  
  802.        gMultiFiles[index]->parID  is 1610667778
  803.        gMultiFiles[index]->vRefNum is 0
  804.  
  805. I have a hard time believing you ever got that many folders
  806. created on your disk.
  807.  
  808. Instead, it looks like a large negative number or something
  809. like that; probably the result of assigning a wdRefNum to
  810. a long.
  811.  
  812. Try swapping the two around, so the dirID is 0 and the
  813. vRefNum is whatever the parID was assigned.
  814.  
  815. - -- 
  816. "You should meet yourself someday. I'm sure you would hate it."
  817. - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
  818.  
  819. ---------------------------
  820.  
  821. From: mhkohne@jupiter.cs.umbc.edu (Michael Kohne)
  822. Subject: Regular reading of a serial device-how?
  823. Date: 13 Apr 92 01:57:08 GMT
  824. Organization: University of Maryland Baltimore Campus, Computer Science Department
  825.  
  826. I've got an interesting situation. I have come by a graphics tablet that is a
  827. serial device, and I want to hook it to my mac. This should be simple, as I
  828. know the format of the data it's sending, and I know how to use the serial
  829. ports on the mac. There's only one problem: I need to check the serial ports
  830. pretty regularly in order to do this, but the Control and Status driver
  831. calls might move or purge memory, and therefore can't be called from any sort
  832. of interrupt-level routine like a VBL task. Then I thought of using an
  833. interrupt routine directly, but since that would involve playing with the
  834. hardware directly, it's not a good idea.
  835.  
  836. What I'd really like is either:
  837. 1) a way to call the serial drivers from a VBL task.
  838. 2) a way to get some code called regularly (every 10 ticks or so), but NOT
  839. at interrupt level. I can't think of any way either of these can be done,
  840. so I ask you: any ideas? 
  841.  
  842. respond email, and I'll post a summary.
  843.  
  844. Michael Kohne
  845. "Pope" Q.E.D
  846.  
  847. - -- 
  848. "Pope" Q.E.D         Lord High Jabberwocky
  849. Michael Kohne        mhkohne@jupiter.cs.umbc.edu
  850. Coded Message: FIME NDUXXMS MZP FTQ EXUFTK FAHQE SKDQ MZP SUYNXQ UZ FTQ IMNQ.
  851.  
  852. +++++++++++++++++++++++++++
  853.  
  854. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  855. Date: 13 Apr 92 08:09:17 GMT
  856. Organization: Royal Institute of Technology, Stockholm, Sweden
  857.  
  858. > mhkohne@jupiter.cs.umbc.edu (Michael Kohne) writes:
  859.  
  860.    1) a way to call the serial drivers from a VBL task.
  861.  
  862. Can't help you there
  863.  
  864.    2) a way to get some code called regularly (every 10 ticks or so), but NOT
  865.    at interrupt level. I can't think of any way either of these can be done,
  866.    so I ask you: any ideas? 
  867.  
  868. Hey, how about a simple application that passes a value < 10 to
  869. WaitNextEvent ? Could even make it faceless background...
  870.  
  871. Or you could write a driver (DRVR) and have an INIT install it;
  872. DRVRs get regular time from SystemTask.
  873.  
  874. Or you could patch one of the "regularies" like _OSEvent or
  875. _SystemTask - but that degrades system performance a lot.
  876.  
  877. Hope this helps !
  878.  
  879. - -- 
  880. "You should meet yourself someday. I'm sure you would hate it."
  881. - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
  882.  
  883. +++++++++++++++++++++++++++
  884.  
  885. From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
  886. Date: 14 Apr 92 18:35:40 GMT
  887.  
  888. In <D88-JWA.92Apr13090917@hemul.nada.kth.se> d88-jwa@hemul.nada.kth.se (Jon W{tte) writes:
  889.  
  890. >> mhkohne@jupiter.cs.umbc.edu (Michael Kohne) writes:
  891.  
  892. >   2) a way to get some code called regularly (every 10 ticks or so), but NOT
  893. >   at interrupt level. I can't think of any way either of these can be done,
  894. >   so I ask you: any ideas? 
  895.  
  896. >Or you could write a driver (DRVR) and have an INIT install it;
  897. >DRVRs get regular time from SystemTask.
  898.  
  899. >Or you could patch one of the "regularies" like _OSEvent or
  900. >_SystemTask - but that degrades system performance a lot.
  901.  
  902. DRVRs get time, but I wouldn't exactly call it regular.  If you NEED to
  903. be called every 10 ticks, right now a VBL task is the only way I know
  904. of to ensure you get the time.  Most applications (and much system
  905. software) that I've seen don't release processor time when tracking
  906. mouseDowns, so if the user holds down the mouse button for more than
  907. ten ticks (which is not uncommon), you could be left high and dry...
  908.  
  909.     - Scott
  910.  
  911. ---------------------------
  912.  
  913. From: swb1_ltd@uhura.cc.rochester.edu (Steve Berkley)
  914. Subject: How to read 10 sectors per track on floppy? (Repost)
  915. Date: 13 Apr 92 14:55:22 GMT
  916. Organization: University of Rochester - Rochester, New York
  917.  
  918. I'm posting this question again, in case anyone didn't see the
  919. original.
  920.  
  921. I'm looking for a way to read sectors off of diskettes for a  
  922. keyboard sampler, which are formatted quite like IBM diskettes-
  923. 10 sectors per track, 80 tracks on two sides.  The mac drive
  924. (.sony driver) reads at 8-12 sectors per track, depending on the
  925. location of the track on the physical disk (for optimum storage
  926. space).  What I'd like to do is be able to tell the driver to
  927. read sectors 0-9 on *each* track.       
  928.  
  929. Most have said that this requires a new driver...lots of work.
  930. Does anyone have a simple solution?
  931.  
  932. - -Steve Berkley
  933. swb1_ltd@uhura.cc.rochester.edu
  934.  
  935. +++++++++++++++++++++++++++
  936.  
  937. From: russotto@eng.umd.edu (Matthew T. Russotto)
  938. Date: 13 Apr 92 17:09:27 GMT
  939. Organization: College of Engineering, University of Maryland, College Park
  940.  
  941. In article <1992Apr13.145522.4052@galileo.cc.rochester.edu> swb1_ltd@uhura.cc.rochester.edu (Steve Berkley) writes:
  942. >I'm posting this question again, in case anyone didn't see the
  943. >original.
  944. >
  945. >I'm looking for a way to read sectors off of diskettes for a  
  946. >keyboard sampler, which are formatted quite like IBM diskettes-
  947. >10 sectors per track, 80 tracks on two sides.  The mac drive
  948. >(.sony driver) reads at 8-12 sectors per track, depending on the
  949. >location of the track on the physical disk (for optimum storage
  950. >space).  What I'd like to do is be able to tell the driver to
  951. >read sectors 0-9 on *each* track.       
  952.  
  953. You can't do this on an 800K drive, but if you have an FDHD (and
  954. appropriate support chips), ask the .Sony driver to read it in IBM
  955. format-- the tech notes have the documentation for that driver.  
  956.  
  957. Originally you said that the diskette was recorded in GCR format.  If
  958. so, you have a really strange disk, and will need to write a new
  959. driver.  I didn't know anyone other than Apple used GCR for 3.5"
  960. floppies.
  961.  
  962.  
  963. - -- 
  964. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  965. Some news readers expect "Disclaimer:" here.
  966. Just say NO to police searches and seizures.  Make them use force.
  967. (not responsible for bodily harm resulting from following above advice)
  968.  
  969. ---------------------------
  970.  
  971. From: neal@farallon.com (Neal Trautman)
  972. Subject: WWDC Dinner?
  973. Date: 9 Apr 92 13:29:36 GMT
  974. Organization: Farallon Computing, Inc.
  975.  
  976.  
  977. Is there any info on an Internetters dinner at
  978. Apple's World Wide Developer Conference?
  979.  
  980. - --
  981. Neal Trautman
  982. Timbuktu Lead Software Engineer
  983. Farallon Computing, Inc.
  984. neal@farallon.com
  985.  
  986. +++++++++++++++++++++++++++
  987.  
  988. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  989. Date: 14 Apr 92 00:10:57 GMT
  990. Organization: Peirce Software
  991.  
  992.  
  993. In article <254@farallonfarallon.com> (comp.sys.mac.programmer), neal@farallon.com (Neal Trautman) writes:
  994. > Is there any info on an Internetters dinner at
  995. > Apple's World Wide Developer Conference?
  996.  
  997. Sure is.  It's been talked about some here already.  Thursday is the
  998. night and Gorden Biersch is the place.  Send me email to have your
  999. name put on the reservation list.
  1000.  
  1001. - --  Michael Peirce         --   peirce@outpost.SF-Bay.org
  1002. - --  Peirce Software        --   Suite 301, 719 Hibiscus Place
  1003. - --  Macintosh Programming  --   San Jose, California USA 95117
  1004. - --           & Consulting  --   voice: (408) 244-6554 fax: (408) 244-6882
  1005. - --                         --   AppleLink: peirce & America Online: AFC Peirce
  1006.  
  1007. ---------------------------
  1008.  
  1009. From: dfrick@uhunix.uhcc.Hawaii.Edu (Doug Frick)
  1010. Subject: archive site for Frontier stuff?
  1011. Date: 13 Apr 92 17:54:24 GMT
  1012. Organization: University of Hawaii at Manoa
  1013.  
  1014. I'm posting the following in hopes that someone out in Netland is
  1015. interested in supporting an archive site for Frontier-related
  1016. stuff. It is a pretty cool application, and allows all us Mac
  1017. techies to script our environments. 
  1018. - ---------------------------------------------------------------------------
  1019. From: EL.GRANDE@AppleLink.Apple.COM (UserLand SW, David Winer,PRT)
  1020.  
  1021. Doug:
  1022.  
  1023. We're not on the Internet at all. If you know anyone who might want to act as a
  1024. pipeline for demo scripts, toolkits and install files, we'd love to open the
  1025. channel.
  1026.  
  1027. Is there some place you could re-post this message? We're looking for someone
  1028. with both an Internet and an AppleLink or CompuServe account.
  1029.  
  1030. This question comes up all the time and we'd really like to get in the loop.
  1031. Getting educated on Internet culture isn't an option for us right now, we're
  1032. overloaded with supporting AppleLink and CompuServe. That may change, but not
  1033. in the next few months...
  1034.  
  1035. DW
  1036. - --
  1037. Doug Frick
  1038. dfrick@uhunix.uhcc.Hawaii.edu
  1039.  
  1040. ---------------------------
  1041.  
  1042. From: winer@husc8.harvard.edu (Adam Winer)
  1043. Subject: What is Discipline?
  1044. Date: 13 Apr 92 18:52:04 GMT
  1045.  
  1046.  
  1047. Does anyone out there know what Discipline is?  I downloaded it from
  1048. ftp.apple.com a couple days ago.  It appears to be some sort of a
  1049. debugging tool, but the instructions that came with it were
  1050. extremely skimpy.  Is it designed for use with Macsbug (which I have)
  1051. or with MPW (which I don't have)?  Does anyone have access to complete
  1052. instructions?
  1053.  
  1054. Thanks,
  1055. Adam
  1056. - -- 
  1057. Adam Winer        | The number you have reached is imaginary.
  1058. WINER@HARVARD.EDU    | Please rotate your phone 90 degrees and
  1059.                         | try again.
  1060.  
  1061. +++++++++++++++++++++++++++
  1062.  
  1063. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  1064. Organization: University of Illinois at Urbana
  1065. Date: Mon, 13 Apr 1992 20:24:55 GMT
  1066.  
  1067. winer@husc8.harvard.edu (Adam Winer) writes:
  1068.  
  1069.  
  1070. >Does anyone out there know what Discipline is?  I downloaded it from
  1071. >ftp.apple.com a couple days ago.  It appears to be some sort of a
  1072. >debugging tool, but the instructions that came with it were
  1073. >extremely skimpy.  Is it designed for use with Macsbug (which I have)
  1074. >or with MPW (which I don't have)?  Does anyone have access to complete
  1075. >instructions?
  1076.  
  1077. It's a parameter checker for Toolbox calls; i.e. it will complain if you
  1078. pass obviously wrong stuctures to the Toolbox. For example, a rectangle
  1079. with right < left (the Finder tends to do this!). Turn it on in macsbug
  1080. with 'dsca'; the same command toggles it off. 'dsc' will turn it on/off for
  1081. the entire machine rather than only the current application, but you don't want
  1082. to do this (unless you feel like it complaining about the Finder).
  1083. - -- 
  1084. Mark Lanett, Software Tools Group, NCSA           mlanett@uiuc.edu or  NCSA.STG
  1085. "People wander in and out of virtual rooms in virtual settings with virtual
  1086. characters and virtual money and virtual armor and virtual weapons, which is
  1087. virtually a good way to spend time, but not quite." -- Usenet Oracle
  1088.  
  1089. +++++++++++++++++++++++++++
  1090.  
  1091. From: nagle@netcom.com (John Nagle)
  1092. Date: Tue, 14 Apr 92 00:06:22 GMT
  1093. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  1094.  
  1095. winer@husc8.harvard.edu (Adam Winer) writes:
  1096. >Does anyone out there know what Discipline is?  I downloaded it from
  1097. >ftp.apple.com a couple days ago.  It appears to be some sort of a
  1098. >debugging tool, but the instructions that came with it were
  1099. >extremely skimpy.  Is it designed for use with Macsbug (which I have)
  1100. >or with MPW (which I don't have)?  Does anyone have access to complete
  1101. >instructions?
  1102.       Discipline is documented, more or less, in the Macsbug manual,
  1103. which can be ordered from APDA.
  1104.  
  1105.       Discipline is an attempt to remedy the fact that the Mac toolbox,
  1106. operating system, and packages don't adequately check arguments on calls.
  1107. When started, Discipline reads in a file of interpretive statements
  1108. which define checks to be made for each system and toolbox call.
  1109. These checks are then made when checking is enabled with a Macsbug
  1110. command.  The checker is slow; turning on Discipline may slow programs
  1111. by an order of magnitude.  (If these checks were built into the Toolbox
  1112. code, they'd probably only cost a few percent performance).  
  1113.  
  1114.       When Discipine detects an error, it causes a trap to Macsbug, with
  1115. a reasonable error message identifying the problem.
  1116.  
  1117.       Discipline doesn't distinguish clearly between calls which are 
  1118. flatly wrong and calls which are returning an unusual result.  Attempting
  1119. to read in a resource that isn't present will cause a Discipline trap,
  1120. even for calls where this just returns an error code, without causing
  1121. "undefined results", as IM puts it.  This reflects a Lint-like approach
  1122. to error handling, where false alarms are a problem.
  1123.  
  1124.       Annoyingly, the Finder isn't clean enough to pass Discipline, and
  1125. running under MultiFinder (at least prior to System 7) with Discipline
  1126. on generates occasional traps.  This really ought to be fixed; there are
  1127. only a few places where the Finder fails Discipline checks.  (The
  1128. Macsbug manual has an amusing comment on this subject, along the
  1129. lines of "nothing is wrong, it's OK for Apple code to violate Discipline)
  1130. Haven't tried this under system 7 yet.
  1131.  
  1132.        Discipline ranks with "lint" as a concept; it is intended to
  1133. catch common errors, not to guarantee that specific classes of errors
  1134. have been eliminated.
  1135.  
  1136.                     John Nagle
  1137.  
  1138. ---------------------------
  1139.  
  1140. From: johnson@vixvax.mgi.com
  1141. Subject: 32K boundary problem?
  1142. Date: 13 Apr 92 20:42:24 GMT
  1143. Organization: Management Graphics, Inc.
  1144.  
  1145. Can someone help me with this problem?
  1146.  
  1147. I'm programming in C using MPW 3.0 and have run into a problem related
  1148. the size of an array.  The program works as the following:
  1149.  
  1150. #define MAXLINES 4096
  1151.  
  1152. void routine(void) {
  1153.     rcPtr    scanList[MAXLINES];
  1154. ...
  1155.  
  1156. but the program bombs on the call to _routine_ if MAXLINES is declared
  1157. as 8192.  (rcPtr is an 8 byte structure by the way).
  1158.  
  1159. This has to be a 32K boundary problem.  How do I get around it (short of 
  1160. redefining my algorithm to eliminate the array, please).
  1161.  
  1162. Thanks in advance.
  1163. - -- 
  1164. ******************************************************************************
  1165. * Woody Johnson     * johnson@vixvax.mgi.com   * I used to paint the princess*
  1166. * 10816 Quinn Ave S * Management Graphics, Inc * I used to paint the frogs   *
  1167. * Bloomington, MN   * 1401 E 79th St, #6       * Now paint mustaches          *
  1168. *           55437   * Bloomington, MN 55425    * on dangerous dogs         *
  1169. *             *                    *           - Don Henley *
  1170. ******************************************************************************
  1171.  
  1172. +++++++++++++++++++++++++++
  1173.  
  1174. From: time@ice.com (Tim Endres)
  1175. Date: 14 Apr 92 02:27:48 GMT
  1176. Organization: ICE Engineering, Inc.
  1177.  
  1178.  
  1179. In article <1992Apr13.154225.1766@vixvax.mgi.com> (comp.sys.mac.programmer), johnson@vixvax.mgi.com writes:
  1180. > #define MAXLINES 4096
  1181. > void routine(void) {
  1182. >     rcPtr    scanList[MAXLINES];
  1183. > ...
  1184. > but the program bombs on the call to _routine_ if MAXLINES is declared
  1185. > as 8192.  (rcPtr is an 8 byte structure by the way).
  1186. > This has to be a 32K boundary problem.  How do I get around it (short of 
  1187. > redefining my algorithm to eliminate the array, please).
  1188.  
  1189. This is more likely your stack crawling down over the top of your
  1190. heap. Remember that the heap and stack grow towards eachother. What
  1191. you need to do is decrease the fire wall that limits the heap's growth,
  1192. which allows the stack to get bigger without clobbering it. Here is
  1193. the a sample of increasing your "stack size":
  1194.  
  1195.     /* Increase stack space by 16,000 bytes */
  1196.     
  1197.     SetApplLimit(GetApplLimit() - 16000);
  1198.     
  1199.     /* Expand the application heap zone to the maximum. */
  1200.     
  1201.     MaxApplZone();
  1202.     
  1203.     /* Allocate some master pointers. */
  1204.     
  1205.     MoreMasters();
  1206.     MoreMasters();
  1207.     MoreMasters();
  1208.     
  1209.     InitGraf(&qd.thePort);
  1210.     InitFonts();
  1211.     InitWindows();
  1212.     InitMenus();
  1213.     TEInit();
  1214.     InitDialogs(NULL);
  1215.     InitAllPacks();
  1216.  
  1217.  
  1218. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  1219. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  1220. 8840 Main Street, Whitmore Lake, MI  48189
  1221. USENET - a slow moving self parody... ph
  1222.  
  1223. ---------------------------
  1224.  
  1225. End of C.S.M.P. Digest
  1226. **********************
  1227.